import service from "@/utils/request"

import LoginWork from "@/utils/LoginWork"

// 币别
export const CurrencyData = () => {
    return service.get('/quotation/getCurrency')
}

// 报价型体资料
export interface QuoteTypeDatT {
    check: number | String,
    custom: String,
    endTime: String,
    loginName: String,
    quotation: number | String,
    season: String,
    startTime: String,
    style: String,
}

export interface TypequotesReturnData {
    companyId: String,
    style: String,
    color: String,
    slipNo: String,
    styleName: String,
    custStyle: String,
    custom: String,
    season: String,
    solePart: String,
    lastMold: null,
    stylePhoto: String,
    sysUser: String,
    sysDate: String,
    cutTool: String,
    sizeRegion: String
    backgroundColor?:string
    check:string
}

export interface TypeList {
    list: TypequotesReturnData[]
    total: number
}
/**
 * 左侧报价型体资料表格数据
 * @param parms QuoteTypeDatT
 * @returns TypequotesReturnData
 */
export const QuoteTypeData = (parms: QuoteTypeDatT) => {
    return service.post<any, TypeList>(`/quotation/quotationList`, parms)
}

/**
 * 报价资料作业 - 类型筛选
 */
export const TypeFilteringData = () => {
    return service.get('/quotation/getMtlProperty')
}

/**
 * 右侧报价型体资料表格数据
 * @param parms QuoteTypeDatT
 * @returns TypequotesReturnData
 */

export interface QuoteTypeDataRightInt {
    mtlProperty?: String
    slipNo: String
    style: String
}

export interface QuoteTypeDataRightC {
    amt:null
    cfmFlag:null
    color:String
    companyId:String
    costUsage:null
    currency:String
    jgPrice:null
    midUsage:number
    mtlColor: String
    mtlName:String
    mtlNo:String
    mtlProperty:null
    mtlSpec:String
    mtlType:String
    mtlUnit:String
    partName:String
    price:null
    remark:null
    seqNo:String
    slipDate:String
    slipNo : String
    stdUsage:0.0202
    style:String
    sysDate:String
    sysUser:String
    vendor:String
}


export interface QuoteTypeDataRightL{
    AMT: String
    COST_NAME: String
}

export interface QuoteTypeDataRightCT{
    list:QuoteTypeDataRightC[]
    maps:QuoteTypeDataRightL[]
    rate: number
    total:number
    totalPrice:number
}

export const QuoteTypeDataRight = (parms: QuoteTypeDataRightInt) => {
    return service.post<any,QuoteTypeDataRightCT>(`/quotation/quotationListDetail`, parms)
}

// 取型体查询
export interface FetchBodyQueryData{
    styleNo: String
    styleColor: String
    custNo: String
    styleName: String
    custStyle: String
    season: String
    shoeSex: String
    cutTool: String
    lastMode: null
    solePart: String
    sysUser: String
    techPerson: String
    baseSize: number
    midSize: number
    stylePhoto: String
}

// 取型体参数
export interface TakeThebodyParameters{
    brand?:String
    custStyle?:String
    pageNum?:Number
    pageSize?:Number
    season?:String
    shoeName?:String
    style?:String
}

export interface FetchBodyQueryDataT{
    list:[],
    total:number
}

export const FetchBodyQueryGetData = (parms?:TakeThebodyParameters) => {
    return service.post<any,FetchBodyQueryDataT>('/quotation/getQuotation',parms)
}

export interface trademark{
    seasons:[],
    brands:[]
}

// 品牌
export const BrandData = () => {
    return service.get<any,trademark>('/quotation/quotationCondition') 
}

// 项目类型
export const projecttype = () => {
    return service.get<any,any>('/quotation/getMtlProperty')
}

// 取型体里面的 品牌 和 季度
export const TakeTheShapeOfTheBrandConst = () => {
    return service.get<any,trademark>('/quotation/getQuotationCondition')
} 

// 新增报价资料
export interface NewQuotationLnformation{
    color:String,
    costUsage:String,
    currency:String,
    jgPrice:Number | null,
    mtlColor:String,
    mtlName:String,
    mtlProperty:String,
    mtlSpec:String,
    mtlType:String,
    mtlUnit:String,
    partName:String,
    price:Number | null,
    seqNo:number | null,
    slipNo:String,
    style:String,
    vendor:String
}

interface  AddNewQuotesA{
    code: 200
    data: null
    message:string
}

export const AddNewQuotes = (parms:NewQuotationLnformation) => {
    return LoginWork.put<any,AddNewQuotesA>('/quotation/setQuotationTypeDetail',parms)
}

export interface TickData{
    seqNos:string[],
    slipNo:string,
    style:string
}

// 打勾删除
export const deleteTickData = (parms?:TickData) => {
    return LoginWork.post<any,AddNewQuotesA>('/quotation/deleteQuotationTypeDetail',parms)
}

// 导入勾选

export const ImportCheck = (parms:string[]) => {
    return LoginWork.post<any,AddNewQuotesA>('/quotation/putQuotation',parms)
}

export interface removeTheCheck{
    slipNo:[],
    style:[]
}


// 打勾
export const removeTheCheckmark= (parms:removeTheCheck) => {
    return LoginWork.post<any,AddNewQuotesA>('/quotation/deleteQuotationType',parms)
}

export interface checkParameter{
    check:string,
    list:list[]
} 

export interface list {
    style: string,
    color: string,
    slipNo: string
}


// 打勾取消检核
export const TickToCancelCheck = (parms:checkParameter) => {
    return LoginWork.put<any,AddNewQuotesA>(`/quotation/updateQuotationStyleCheck`,parms)
}


// 更新币别
export const TheNewCurrencyIsDifferent = (parms:any) => {
    return LoginWork.put<any,any>(`/quotation/updateUsdAndTypeName`,parms)
}

// 勾选型体
export const checkbox = (parms:any) => {
    return LoginWork.post<any,any>(`/quotation/gouXQuotation`,parms)
}